// @Author EthanScriptOn
// @Desc
package node

// Node Node interface, which defines the capabilities that a node should have
type Node interface {
	// SlotNode Node storage, slotWay is the direction of storage, prepare is the node ready to be inserted
	SlotNode(slotWay OptionDirection, prepare Node) error
	// DetachNode Removes the current node
	DetachNode() error
	// GetExtremityNode Get the last node under Directions
	GetExtremityNode(direction OptionDirection) (Node, bool, error)
	// GetAdjacentNode Get the next node under the direction
	GetAdjacentNode(direction OptionDirection) (Node, bool, error)
}

// NodeInformation Node information
type NodeInformation interface {
	NodeElem() Node
}

// OptionDirection The storage direction of the node
type OptionDirection string

const (
	HEAD OptionDirection = "HEAD"
	TAIL OptionDirection = "TAIL"
)
